package com.avicit.zipkinkafkaesserver.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 接口耗时列表统计
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ZipkinInterfaceDuration implements Serializable {

  @Id
  private String id;
  private String spanId;
  private String interfaceIp;
  private String serverName;
  private Integer serverPort;
  private String interfacePath;
  private Long interfaceStatusCode;
  private String interfaceErrorMsg;
  private Double interfaceDuration;
  private String interfaceMethod;
  private Long interfaceReqDuration;
  private Long interfaceRespDuration;

  //抓取es 记录中的开始时间
  private Long esStartTime;
  //抓取es 记录中的结束时间
  private Long esEndTime;


  @Temporal(TemporalType.TIMESTAMP)
  @CreationTimestamp
  private Date createTime;
  @Temporal(TemporalType.TIMESTAMP)
  @UpdateTimestamp
  private Date updateTime;

  private String queryKey;

}
